<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        // 定义一个数组
        var arr = [45,56,76,88,89,90,100,34,56,85];
        // 累加求和
        var sum = 0;
        for (var i = 0 ; i < arr.length ; i++) {
            sum += arr[i];
        }
        // 求平均值 
        var avg = sum / arr.length;
        // 数组遍历  利用for循环
        var a = 0;
        for (var j = 0; j <= arr.length; j++) {
            if (arr[j] >= avg) {
                a++;
            }
        }       
        // 输出结果
        console.log("大于等于平均成绩" + avg + "的人数有" + a);
    </script>
</head>
<body>
    
</body>
</html>